package router

import (
	"api-getwary/handler/api"
	"api-getwary/until"
	"github.com/gin-gonic/gin"
)

func Router() *gin.Engine {
	r := gin.Default()
	user := r.Group("user")
	{
		user.POST("register", api.Register)
		user.POST("login", api.Login)
	}

	video := r.Group("video")
	{

		video.Use(until.JWTAuth())

		video.POST("videoadd", api.Videoadd)
		video.POST("videoUpdate", api.VideoUpdate)
		video.POST("videoShow", api.VideoShow)
		video.POST("videolist", api.Videolist)
		video.POST("videoDeleted", api.VideoDeleted)
	}
	return r
}
